Skip to content

Fixed-Strain diffusion flames#22

Open
bigfooted wants to merge 5 commits into
developfrom
feature_fixed_strain
Open

Fixed-Strain diffusion flames#22
bigfooted wants to merge 5 commits into
developfrom
feature_fixed_strain

Conversation

@bigfooted

Copy link
Copy Markdown
Collaborator

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

  1. add option to create fixed strain diffusion LUT
  2. when flamelet files (.yaml) exist, restart from these solutions
  3. additional plotting options to create x,y figures and 2d flat contour figures.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • I have updated the list of python modules in required_packages.txt and environment.yml, if necessary.
  • I have properly commented my changes.
  • I have updated the documentation, if necessary.
  • I have added a test case that demonstrates my contribution, if necessary.

@EvertBunschoten

Copy link
Copy Markdown
Member

Could you also add the counter-flow flamelets to the flamelet options in Data_Processing/DataPlotters.py:DataPlotters_FGM? That way you can easily plot and inspect the flamelet data.

@EvertBunschoten EvertBunschoten left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warm restart functionality can be improved. In its current form, it seems quite redundant as the adiabatic and burner-stabilized flamelets already restart from the previously converged solution object without having to write a yaml file.

Comment on lines +139 to +145
self.__counterflow_fixed_strain = getattr(self._Config, '_Config_FGM__counterflow_fixed_strain', DefaultSettings_FGM.counterflow_fixed_strain)
self.__counterflow_strain_rate = getattr(self._Config, '_Config_FGM__counterflow_strain_rate', DefaultSettings_FGM.counterflow_strain_rate)
try:
self.__counterflow_fixed_strain = self._Config.GetCounterFlowFixedStrain()
self.__counterflow_strain_rate = self._Config.GetCounterFlowStrainRate()
except AttributeError:
pass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant. Why is there a try/except around the getter function from the config?

Comment on lines +485 to +504
# Build output paths early so we can check for existing files.
if not path.isdir(self.GetOutputDir()+'/freeflame_data/'):
mkdir(self.GetOutputDir()+'/freeflame_data/')
if not path.isdir(self.GetOutputDir()+'/freeflame_data/'+folder_header+'_'+str(round(mix_status, 6))):
mkdir(self.GetOutputDir()+'/freeflame_data/'+folder_header+'_'+str(round(mix_status, 6)))
freeflame_filename = "freeflamelet_"+folder_header+str(round(mix_status,6))+"_Tu"+str(round(T_ub, 4))+".csv"
filename_plus_folder = self.GetOutputDir()+"/freeflame_data/"+folder_header+'_'+str(round(mix_status, 6)) + "/"+freeflame_filename
yaml_plus_folder = filename_plus_folder.replace('.csv', '.yaml')

# If a YAML exists, restore as warm-start before solving.
# Always re-solve and overwrite the CSV (use auto=False when restoring).
warm_started = False
if path.isfile(yaml_plus_folder):
try:
freeflame.restore(yaml_plus_folder, 'solution')
warm_started = True
print("Freeflame at %s %.3e, Tu %.3f: warm-start from YAML." % (folder_header, mix_status, T_ub))
except Exception as exc:
print("Freeflame at %s %.3e, Tu %.3f: YAML restore failed (%s), re-solving from scratch." % (folder_header, mix_status, T_ub, exc))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the purpose of these lines. Lines 481-483 already describe a warm restart capability by just using the previously converged FreeFlame solution.

_, nearest_yaml = min(candidates)
guess_path = path.join(out_dir, nearest_yaml)
try:
flame.restore(guess_path, 'solution')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly as to the FreeFlame and BurnerFlame solutions, why not restart from the previously converged solution object rather than reading the yaml file?

97.0,0.0009485280024819076,4.2398760696917305e-05
98.0,0.0009390524355694652,4.2575587079161074e-05
99.0,0.000929671514313668,4.283483808240152e-05
0.0,0.002511886414140463,0.0032617408828994787

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest not changing the training history reference file until the flamelet generation regression test passes.

consistency_NICFD_PINN = TestCase("PIML training NICFD")
consistency_NICFD_PINN.config_dir = "FluidTraining/MM_PINN/"
consistency_NICFD_PINN.config_file = ""
consistency_NICFD_PINN.tolerance= 0.01

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the tolerance of this regression test adapted? Your changes to the code should not affect the functionalities for NICFD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants